var more_list = document.querySelectorAll(".more-list li");

for (var i = 0; i < more_list.length; i++) {
  more_list[i].addEventListener("mouseover", function (e) {
    for (var j = 0; j < more_list.length; j++) {
      more_list[j].classList.remove("more-list-active");
    }
    var li = e.target;
    li.classList.add("more-list-active");

    //转换数组
    var list_li = Array.from(more_list);
    //将两个部分分为两个数组部分 判断显示部分0为ear-section 1为wear-section
    var index = list_li.indexOf(li);
    var ear_section=document.querySelector(".ear-section");
    var wear_section=document.querySelector(".cloth-section");
    if (index == 0) {
      ear_section.style.opacity = 1;
      wear_section.style.opacity = 0;
    } else if(index == 1){
      ear_section.style.opacity = 0;
      wear_section.style.opacity = 1;
    }
  });
}


// 右下角固定窗口
window.addEventListener("scroll", function () { 
  var scrollTop = document.documentElement.scrollTop||window.pageXOffset;
  if(scrollTop>=400){
    var return_top=document.querySelector(".return-top");
    return_top.classList.remove('right-menu-hidden')
    var right_menu=document.querySelector(".right-menu");
    right_menu.style.top='253px';
  }else{
    var return_top=document.querySelector(".return-top");
    return_top.classList.add('right-menu-hidden')
    var right_menu=document.querySelector(".right-menu");
    right_menu.style.top='360px';

  }
})
